package com.ruoyi.camp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.camp.mapper.CampUserMapper;
import com.ruoyi.camp.domain.CampUser;
import com.ruoyi.camp.service.ICampUserService;

import javax.annotation.Resource;

/**
 * 用户Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-11
 */
@Service
public class CampUserServiceImpl implements ICampUserService {
    @Resource
    private CampUserMapper campUserMapper;

    @Override
    public CampUser selectCampUserByOpenId(String openid) {
        return campUserMapper.selectCampUserByOpenid(openid);
    }

    /**
     * 查询用户
     *
     * @param userid 用户主键
     * @return 用户
     */
    @Override
    public CampUser selectCampUserByUserid(String userid) {
        return campUserMapper.selectCampUserByUserid(userid);
    }

    /**
     * 查询用户列表
     *
     * @param campUser 用户
     * @return 用户
     */
    @Override
    public List<CampUser> selectCampUserList(CampUser campUser) {
        return campUserMapper.selectCampUserList(campUser);
    }

    /**
     * 新增用户
     *
     * @param campUser 用户
     * @return 结果
     */
    @Override
    public int insertCampUser(CampUser campUser) {
        return campUserMapper.insertCampUser(campUser);
    }

    /**
     * 修改用户
     *
     * @param campUser 用户
     * @return 结果
     */
    @Override
    public int updateCampUser(CampUser campUser) {
        return campUserMapper.updateCampUser(campUser);
    }

    /**
     * 批量删除用户
     *
     * @param userids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteCampUserByUserids(Long[] userids) {
        return campUserMapper.deleteCampUserByUserids(userids);
    }

    /**
     * 删除用户信息
     *
     * @param userid 用户主键
     * @return 结果
     */
    @Override
    public int deleteCampUserByUserid(Long userid) {
        return campUserMapper.deleteCampUserByUserid(userid);
    }
}
